package com.sgolub.commanndsonline.domain.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.sgolub.commanndsonline.domain.sec.SecUser;
import com.sgolub.commanndsonline.helpers.CustomDateSerializer;


@Entity
@Table(name = "ENT_USER_ORDER")
public class UserOrder {

    @Id
    @Column(name = "ID")
    @GeneratedValue 
    private Integer id;	
	
    @Column(name = "ORDER_NR")
    private String	orderNr;    
    
    @Column(name = "ORDER_DATE")
    private Date  	orderDate;
    
    @Column(name = "ORDER_STATUS")
    private Integer  	orderStatus;

    @OneToOne
    @JoinColumn(name="FK_SEC_USER_ID")
    private SecUser secUser;
    
   //@Column(name = "FK_SEC_USER_ID")
   //private Integer  	fkSecUserId;
    
    @OneToOne
    @JoinColumn(name="FK_MANAGER_ID")
    private SecUser manager;    
    
  //@Column(name = "FK_MANAGER_ID")
  //private Integer  	fkManagerId;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getOrderNr() {
		return orderNr;
	}

	public void setOrderNr(String orderNr) {
		this.orderNr = orderNr;
	}

	@JsonSerialize(using = CustomDateSerializer.class)
	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public Integer getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(Integer orderStatus) {
		this.orderStatus = orderStatus;
	}

	public SecUser getSecUser() {
		return secUser;
	}

	public void setSecUser(SecUser secUser) {
		this.secUser = secUser;
	}

	public SecUser getManager() {
		return manager;
	}

	public void setManager(SecUser manager) {
		this.manager = manager;
	}

    
	
}
